home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 June / PCpro_2006_06.ISO / files / freeware / openvip.exe / {app} / timeline2network.py < prev    next >
Encoding:
Python Source  |  2003-06-02  |  1.0 KB  |  39 lines

  1. #!/usr/bin/env python
  2.  
  3. #
  4. # This file is part of OpenVIP (http://openvip.sourceforge.net)
  5. #
  6. # Copyright (C) 2002-2003
  7. # Michal Dvorak, Jiri Sedlar, Antonin Slavik, Vaclav Slavik, Jozef Smizansky
  8. #
  9. # This program is licensed under GNU General Public License version 2;
  10. # see file COPYING in the top level directory for details.
  11. #
  12. # $Id: timeline2network.py,v 1.8 2003/06/02 08:30:34 vaclavslavik Exp $
  13. #
  14.  
  15. #
  16. # Generates thumbnail image for an input file.
  17. #
  18.  
  19. import sys, model, xmlhelpers
  20.  
  21. if len(sys.argv) < 4:
  22.     sys.stderr.write('Usage: %s infile.timeline outfile.openvip videofile\n' % sys.argv[0])
  23.     sys.exit(1)
  24.  
  25. vf = model.VideoFormat(640, 480, None)
  26. af = model.AudioFormat(44100, 2)
  27.  
  28. try:
  29.     m = model.load(sys.argv[1])
  30.     params = { 'format': 'FFMpeg' }
  31.     net = m.tonetworkxml(sys.argv[3], vf, af, out_params=params)
  32.     f = open(sys.argv[2], 'wt')
  33.     f.write(net)
  34.     f.close()
  35.     xmlhelpers.formatNicely(sys.argv[2])
  36. except model.Error, e:
  37.     sys.stderr.write('Error processing %s:\n' % sys.argv[1])
  38.     sys.stderr.write('  %s\n' % e.msg)
  39.